<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>校园闲置－商品列表</title>
	</head>
	<body>
		<!-- goods-list-wrapper -->
		<div class="goods-list-wrapper">
			<c:if test="${pagerModel.dates[0] != null && pagerModel.dates[0] != ''}">
				<c:forEach items="${pagerModel.dates}" var="goodsList">
					<!-- glw-goods -->
					<div class="glw-goods">
						<input type="hidden" value="${goodsList.goodsId}">
						<div class="glw-goodsimg">
							<img src="/csht_file/goods_images/${goodsList.goodsImgpath}" alt="商品图">
						</div>
						<div class="glw-goodstd">
							${goodsList.goodsTitle} ${goodsList.goodsContent}
						</div>
						<div class="glw-goodsprice">
							￥<span>${goodsList.goodsPrice}</span>
						</div>
						<div class="glw-goodsusername">
							<img src="/csht_file/user_header/${goodsList.cshtUser.userHeadPath}">
							<span>${goodsList.cshtUser.userUsername}</span>
						</div>
					</div><!-- glw-goods -->
				</c:forEach>
				<jsp:include page="../page/page.jsp">
					<jsp:param name="url" value="${pageContext.request.contextPath}/goods/${MenuOrBrandUrl}"/>
					<jsp:param name="items" value="${pagerModel.totalSize}"/>
					<jsp:param name="maxPageItems" value="${pagerModel.goodsListPageSize}"/>
				</jsp:include>
			</c:if>
			<c:if test="${pagerModel.dates[0] == null || pagerModel.dates[0] == ''}">
				<div class="glw-goods-isnull">
					没有找到相关商品
				</div>
			</c:if>
			
			
		</div><!-- goods-list-wrapper -->
		
		
		<script type="text/javascript">
			$(document).ready(function(){
				$(".glw-goods").on("click", function(){
					var goodsId = $(this).children("input[type='hidden']").val();
					window.open("${pageContext.request.contextPath}/goods/goodsDetails/" + goodsId);
				});
			})
		</script>
	</body>
</html>